//
//  CMBankLoginParser.m
//  CreditManger
//
//  Created by chaiyanan on 15/11/9.
//  Copyright © 2015年 jinxin. All rights reserved.
//

#import "CMBankLoginParser.h"
#import "CMBankLoginInfo.h"

@implementation CMBankLoginParser

-(ParserResult*)parseResponseDictionary:(NSDictionary *)responseDictionary
{
    LLog(@"responseDictionary:%@",responseDictionary);
    ParserResult* result=[[ParserResult alloc]init];
    NSNumber* codeObject=[responseDictionary objectForKey:Key_Code];
    if (codeObject)
    {
        NSInteger code = [codeObject integerValue];
        result.code = code;
        result.message = [responseDictionary objectForKey:Key_Msg];
        if (code == 0||code == 2)
        {
            NSString *dataStr = [responseDictionary objectForKey:Key_Data];
            if (!dataStr)
            {
                dataStr = @"";
            }
            
            CMBankLoginInfo *info = [[CMBankLoginInfo alloc]init];
            info.dataInfo = dataStr;
            result.result = info;
            
        }
        
    }
    else
    {
        result.code=1;
        result.message=@"服务器数据异常";
    }
    
    return result;
}

@end
